<?php
	include ('paperclip_sc_fns.php');
	// The shopping cart needs sessions, so start one
	session_start();

	$sku = $_GET['sku'];

	// get this paperclip out of database
	$paperclip = get_paperclip_details($sku);
	do_html_header($paperclip['title']);
	
	//show categories all the time
	display_shopping_menu($_SESSION['cat_array']);
	display_cart_tool();
	display_paperclip_details($paperclip);

	// set url for "continue button"
	$target = "index.php";
	if($paperclip['catid']) {
		$target = "show_cat.php?catid=".$paperclip['catid'];
	}

	// if logged in as admin, show edit paperclip links
	if(check_admin_user()) {
		display_button("edit_paperclip_form.php?sku=".$sku, "edit-item", "Edit Item");
		//display_button("admin.php", "admin-menu", "Admin Menu");
		display_button($target, "continue", "Continue");
	} else {
		display_button("show_cart.php?new=".$sku, "add-to-cart",
									 "Add".$paperclip['title']." To My Shopping Cart");
		//display_button($target, "continue-shopping", "Continue Shopping");
	}

	do_html_footer();
?>
